<%= link_to_unless_current "Registered Users", :action => "index" %> |
<%= link_to_unless_current "Historical Statistics", :action => "histStat" %>

<% form_tag :action => 'index' do  %>
    <div>
      <%= label_tag 'Search: ' %>
      <%= text_field_tag :sUser , nil, :size => 20 %>
      <%= hidden_field_tag :hidSearch, params[:sUser] %>
      <%= submit_tag "Search", :name => "search" %>
      User Name <%= check_box_tag "chkUser", "User Name"  %> |
      Login Name <%= check_box_tag "chkLogin", "Login Name"  %> |
      E-Mail <%= check_box_tag "chkEMail", "E-Mail"  %>
      <%= hidden_field_tag :hidChkUser, params[:chkUser] %>
      <%= hidden_field_tag :hidChkLogin, params[:chkLogin] %>
      <%= hidden_field_tag :hidChkEmail, params[:chkEMail] %>
    </div>
    <br>
    Search by <%= @sCaption.chop.chop unless @sCaption.nil? %> : <font color="blue"><%= params[:sUser] %></font>
    <br>
    <div class="sidebar_box">
      <table frame="border" border=2 rules=all bgcolor="LightCyan" cellpadding="5">
        <tr>
          <th>Name</th>
          <th>User Name</th>
          <th>E-Mail</th>
          <th>User Type</th>
          <th>Created Date</th>
          <th>Activated Status</th>
          <th>Activated Date</th>
          <th>Excluded?</th>
          <th>Deleted Date</th>
        </tr>
        <% if @users.length > 0 %>
            <% @users.each do |user| %>
                <tr>
                  <td><%= link_to user.user_name, { :controller => "home", :action => "showProfilesToAdmin", :login => user.login  } %></td>
                  <td><%= user.login %></td>
                  <td><%= user.email %></td>
                  <td><%= user.name %></td>
                  <td><%= user.created_at.strftime("%Y-%m-%d %H:%M:%S") %></td>
                  <td><%= user.state %></td>
                  <td><% if user.activated_at.nil? %>
                        <%= user.activated_at %>
                    <% else %>
                        <%= user.activated_at.strftime("%Y-%m-%d %H:%M:%S") %>
                    <% end %>
                  </td>
                  <td align="center">
                    <%= check_box_tag "excUser_ids[]", user.id, user.exclude == "T" ? checked=true : checked=false %>
                    <%= hidden_field_tag "hidUser_ids[]", user.id %>
                  </td>
                  <td><% if user.deleted_at.nil? %>
                        <%= user.deleted_at %>
                    <% else %>
                        <%= user.deleted_at.strftime("%Y-%m-%d %H:%M:%S") %>
                    <% end %>
                  </td>
                </tr>
            <% end %>
        <% end %>
      </table>
    </div>
    <br>
    <% if @users.length > 0 %><%= submit_tag "Save", :name => "save" %><% end %>
<% end %>




